package org.nstack.header.volume;

import org.nstack.header.message.APICreateMessage;
import org.nstack.header.message.APIParam;
import org.nstack.header.storage.primary.PrimaryStorageVO;
import org.nstack.header.storage.snapshot.VolumeSnapshotVO;
import org.springframework.http.HttpMethod;
import org.nstack.header.identity.Action;
import org.nstack.header.rest.RestRequest;


@Action(category = VolumeConstant.ACTION_CATEGORY)
@RestRequest(
        path = "/volumes/data/from/volume-snapshots/{volumeSnapshotUuid}",
        responseClass = APICreateDataVolumeFromVolumeSnapshotEvent.class,
        method = HttpMethod.POST,
        parameterName = "params"
)
public class APICreateDataVolumeFromVolumeSnapshotMsg extends APICreateMessage {

    @APIParam(maxLength = 255)
    private String name;

    @APIParam(required = false, maxLength = 2048)
    private String description;

    @APIParam(resourceType = VolumeSnapshotVO.class, checkAccount = true, operationTarget = true)
    private String volumeSnapshotUuid;

    @APIParam(required = false, resourceType = PrimaryStorageVO.class)
    private String primaryStorageUuid;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getVolumeSnapshotUuid() {
        return volumeSnapshotUuid;
    }

    public void setVolumeSnapshotUuid(String volumeSnapshotUuid) {
        this.volumeSnapshotUuid = volumeSnapshotUuid;
    }

    public String getPrimaryStorageUuid() {
        return primaryStorageUuid;
    }

    public void setPrimaryStorageUuid(String primaryStorageUuid) {
        this.primaryStorageUuid = primaryStorageUuid;
    }
 
    public static APICreateDataVolumeFromVolumeSnapshotMsg __example__() {
        APICreateDataVolumeFromVolumeSnapshotMsg msg = new APICreateDataVolumeFromVolumeSnapshotMsg();
        msg.setDescription("dataVolume-from-snapshot");
        msg.setName("DataVolume-1");
        msg.setPrimaryStorageUuid(uuid());
        msg.setVolumeSnapshotUuid(uuid());

        return msg;
    }

}
